package com.ai.platform.common.page;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class PageContext extends Pagination {
	
	private static final long serialVersionUID = -4311874603534942872L;

	private static final Logger logger = LoggerFactory.getLogger(PageContext.class);

	private static ThreadLocal<PageContext> context = new ThreadLocal<PageContext>();

	public static PageContext getContext() {
		return context.get();
	}
	
	public static PageContext createPage() {
		PageContext ci = context.get();
		if (ci != null) {
			context.remove();
		}
		ci = new PageContext();
		ci.setPagination(true);
		context.set(ci);
		return ci;
	}

	public static void removeContext() {
		context.remove();
	}

}
